public class progr {
	public static long getTime() {
		return System.nanoTime() / 100000000;
	}
	
	public static void main (String[] args){
		  Engine eng = new Engine(800, 600);
		  Ball ball = new Ball("ogre", 4, 4, 0);
		  ball.animation = 1;
		  
		  ball.setSpeeds(50, 50);
		  ball.y = 400;
		  int k = 50;
		  long lastFrameT = getTime();
		  while (true) { 
			  double dt = getTime() - lastFrameT;
			   lastFrameT = getTime();
			   ball.play(dt);
			   ball.animate(dt);
			   
			 if (ball.y >= 600 || ball.x >= 800){
				 k = k+10;
				 ball.setSpeeds(10, k);
				 ball.x = 0;
				 ball.y = 400;
			 }
			  
			  
		   
		  
		   eng.drawSprite(ball.sprite.get(ball.cur_sprite), (int)ball.x, (int)ball.y);
		   eng.render();
		}
	}	
}
